A variety of methods may be used to retain a mattress on a foundation of an adjustable bed. In some cases, metal guides and/or bars may be used to secure at least one end of a mattress with respect to articulating deckboard panels, thereby preventing shifting of the mattress during raising and lowering of the bed. However, while such methods may limit perimeter shifting of a mattress over an edge of a deckboard at an end of the bed, they do not alleviate the gaps formed between the bottom surface of the mattress and the deckboard during articulation of the adjustable bed.